@(id : Long, panier : models.Panier)

@import helper._

@implicitFieldConstructor = @{ FieldConstructor(twitterBootstrapInput.render) } 

@main("Todo list") {
    <header class="topbar">
        <h1 class="fill" align="center">
            <a href="@routes.Application.index()">
				Plateforme de gestion de catalogue de produits
            </a>
        </h1>
    </header>
     @if(flash.containsKey("success")) {
        <div align="center" class="alert-message success">
            <strong>Done!</strong> @flash.get("success")
        </div>
    }else{
	    @if(flash.containsKey("error")){
	    	<div align="center" class="alert-message error">
	            <strong>Done!</strong> @flash.get("error")
	        </div>
	    }
    }
    <h2 style="padding:15px">Your shopping cart</h2>
    
    @form(routes.Paniers.paniers(id)) {
    
    		@if(panier.prodPanier.size!=0){
	        <table style="border:0; cellpadding:0; cellspacing:0; rules:none">
	    		<tr>
	    			<th>PRODUCT NAME</th>
	    			<th>OPTIONS</th>
	    			<th>PRODUCT PRICE</th>
	    			<th>OPTION PRICE</th>
	    		</tr>
	    		@for(produit <- panier.prodPanier) {
		    		<tr>
						<td style="border:5;  cellpadding:3; cellspacing:2; rules:none">
				    		<a class="btn small" href="@routes.Fiches.fiches(id)">@produit.nomProduit</a></td>
			    		
			    		@if(produit.optionProd.size != 0){
			    			@for(option <- produit.optionProd){
			    				<td style="border:5;  cellpadding:3; cellspacing:2; rules:none">
			    					
			    				</td>	
			    			}
			    		}else{
			    			<td style="border:5;  cellpadding:3; cellspacing:2; rules:none"></td>
			    		}
			    		<td style="border:5;  cellpadding:3; cellspacing:2; rules:none">
				    		</td>
				    		
				    	@if(produit.optionProd.size != 0){
			    			@for(option <- produit.optionProd){
			    				<td style="border:5;  cellpadding:3; cellspacing:2; rules:none">
			    				</td>
			    				<td>	
			    				</td>   
			    			}
			    		}else{
			    			<td style="border:5;  cellpadding:3; cellspacing:2; rules:none"></td>
			    		}
				    	
				    	
					    <td style="border:0; cellpadding:0; cellspacing:0; rules:none"><input class="btn small" type="submit" value="Delete Option"></td>
					    <td style="border:0; cellpadding:0; cellspacing:0; rules:none"><input class="btn small" type="submit" value="Delete Product"></td>			    
					  </tr>
	    			}
	    		</table>
	    	}else{
	    		<input class="btn small" type = "submit" value ="Add product">
	    	}
		}
}
